Add a 'length' argument to the 'add' function supporting "max_length" #1224
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was a trivial change but of massive value for me to be able to simply pass a flag to the
logger.add()
function controlling the maximum line length in stack trace diagnostics.The limit of 128 characters is too small, and the only reason I use Loguru is for this functionality, so I'm surprised it's not in place already given how trivial a change it is.
I do not object to the few seconds it takes to scroll to the right to see all variable values - not cut off by three dots - if it means saving hours or days of debugging time.
Note: The code uses the same approach as the existing design pattern of tying the default to a user-settable environment variable. Additionally, the default of 128 remains the same.
I also noticed the convention of single-word arguments to
add
, so I chose "length" as the name of this argument.